﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace TransferPriceMiddleNT
{
    public class HostServicoMain
    {
        public static void Main(string[] args)
        {
            #region Declaração dos hosts

            ServiceHost hostCalendario = new ServiceHost(typeof(itau.im.negocio.CalendarioBS), new Uri[] { });
            ServiceHost hostConfiguracoes = new ServiceHost(typeof(itau.im.negocio.ConfiguracoesBS), new Uri[] { });
            ServiceHost hostControleAcesso = new ServiceHost(typeof(itau.im.negocio.ControleAcessoBS), new Uri[] { });
            ServiceHost hostConversorTaxas = new ServiceHost(typeof(itau.im.negocio.ConversorTaxasBS), new Uri[] { });
            ServiceHost hostCurva = new ServiceHost(typeof(itau.im.negocio.CurvaBS), new Uri[] { });
            ServiceHost hostExecucao = new ServiceHost(typeof(itau.im.negocio.ExecucaoCurvaBS), new Uri[] { });
            ServiceHost hostGrupoParametros = new ServiceHost(typeof(itau.im.negocio.GrupoParametrosBS), new Uri[] { });
            ServiceHost hostImportadorArquivos = new ServiceHost(typeof(itau.im.negocio.ImportadorArquivoVertices), new Uri[] { });
            ServiceHost hostMesa = new ServiceHost(typeof(itau.im.negocio.MesaBS), new Uri[] { });
            ServiceHost hostMoeda = new ServiceHost(typeof(itau.im.negocio.MoedaBS), new Uri[] { });
            ServiceHost hostParametroAtribuicao = new ServiceHost(typeof(itau.im.negocio.ParametroAtribuicaoBS), new Uri[] { });
            ServiceHost hostPricing = new ServiceHost(typeof(itau.im.negocio.PricingBS), new Uri[] { });
            ServiceHost hostProdutoFinanceiro = new ServiceHost(typeof(itau.im.negocio.ProdutoFinanceiroBS), new Uri[] { });
            ServiceHost hostRegraAtribuicao = new ServiceHost(typeof(itau.im.negocio.RegraAtribuicaoBS), new Uri[] { });

            #endregion

            #region Abertura dos hosts

            hostCalendario.Open();
            hostConfiguracoes.Open();
            hostControleAcesso.Open();
            hostConversorTaxas.Open();
            hostCurva.Open();
            hostExecucao.Open();
            hostGrupoParametros.Open();
            hostImportadorArquivos.Open();
            hostMesa.Open();
            hostMoeda.Open();
            hostParametroAtribuicao.Open();
            hostPricing.Open();
            hostProdutoFinanceiro.Open();
            hostRegraAtribuicao.Open();

            #endregion

            #region Serviço

            Console.WriteLine("Serviço rodando...");
            Console.WriteLine("Tecle para finalizar.");
            Console.ReadKey();

            #endregion

            #region Fechamento dos hosts

            hostCalendario.Close();
            hostConfiguracoes.Close();
            hostControleAcesso.Close();
            hostConversorTaxas.Close();
            hostCurva.Close();
            hostExecucao.Close();
            hostGrupoParametros.Close();
            hostImportadorArquivos.Close();
            hostMesa.Close();
            hostMoeda.Close();
            hostParametroAtribuicao.Close();
            hostPricing.Close();
            hostProdutoFinanceiro.Close();
            hostRegraAtribuicao.Close();

            #endregion
        }
    }
}
